package com.cys.dm.client.item;

import com.cys.dm.entity.item.DmItem;
import com.cys.dm.entity.item.DmItemType;
import com.cys.dm.vo.dmes.DmItemRowsEs;
import com.cys.dm.vo.dmitem.DmItemRowsPageResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "dm-item-provider")
@Component
public interface DmItemClient {

    @PostMapping(path = "getCalendarData2/{itemTypeId}/{startTime}")
    public List<DmItem> getCalendarData2(@PathVariable("itemTypeId")Long itemTypeId,@PathVariable("startTime")String startTime);

    @PostMapping(path = "getCalendarData/{itemTypeId}")
    public List<DmItem> getCalendarData(@PathVariable("itemTypeId")Long itemTypeId);

    @PostMapping(path = {"findDmItemByAgeAndPageSize/{age}/{pageSize}"})
    public List<DmItem> findDmItemByAgeAndPageSize(
            @PathVariable("age")Integer age,
            @PathVariable("pageSize")Integer pageSize
    );

    @PostMapping(path = "/findByParent/{parent}")
    public List<DmItemType> dmItemTypeList(@PathVariable("parent")Long parent);

    @PostMapping(path = "/hotItemList")
    public List<DmItem> hotItemList(@RequestParam("itemTyp1Id") Long itemTyp1Id,
                                    @RequestParam("isBanner") Long isBanner,
                                    @RequestParam("isRecommend") Long isRecommend);


    @PostMapping(path = "/findByLinAsNav")
    public List<DmItemType> findBylinAsNav();

    @PostMapping(path = "/todayRecommend")
    public List<DmItem> todayRecommend();

    @PostMapping(path = "/queryToSaleItem")
    public List<DmItem> queryToSaleItem();

    @PostMapping(path = "/queryFloorItems")
    public List<DmItem> queryFloorItems(@RequestParam("itemTyp1Id")Long itemTyp1Id);

    @PostMapping(path = "/postIndexSeniority")
    public List<DmItem> postIndexSeniority(@RequestParam("itemTyp1Id")Long itemTyp1Id);

    @PostMapping(path = "findByIdForItem")
    public  DmItem findByIdForItem(@RequestParam("id") Long id);

    @PostMapping(path = {"hotItem/{itemTypeId}/{isBanner}/{isRecommend}/{current}/{size}"})
    public List<DmItem> findHotItem(
            @PathVariable("itemTypeId")Long itemTypeId,
            @PathVariable("isBanner")Long isBanner,
            @PathVariable("isRecommend")Long isRecommend,
            @PathVariable("current")Long current,
            @PathVariable("size")Long size
    );

}
